home *** CD-ROM | disk | FTP | other *** search
- // Copyright 1999 Macromedia, Inc. All rights reserved.
-
- function receiveArguments()
- {
- var itemID = arguments[0];
- var docPath = dw.getDocumentPath('document');
- if (itemID == "connect")
- {
- if (site.getConnectionState() == true)
- site.setConnectionState(false);
- else
- site.setConnectionState(true);
- }
- if (itemID == "put")
- {
- if (dw.getFocus() == 'site')
- site.put("site");
- else
- site.put(docPath);
- }
- if (itemID == "get")
- {
- if (dw.getFocus() == 'site')
- site.get("site");
- else
- site.get(docPath);
- }
- if (itemID == "checkout")
- {
- if (dw.getFocus() == 'site')
- site.checkOut("site");
- else
- site.checkOut(docPath);
- }
- if (itemID == "checkin")
- {
- if (dw.getFocus() == 'site')
- site.checkIn("site");
- else
- site.checkIn(docPath);
- }
- if (itemID == "undocheckout")
- {
- if (dw.getFocus() == 'site')
- site.undoCheckOut("site");
- else
- site.undoCheckOut(docPath);
- }
- if (itemID == "findlocal")
- {
- if (dw.getFocus() == 'site')
- site.findInSiteFiles("local","site");
- else
- site.findInSiteFiles("local", docPath);
- }
- if (itemID == "findremote")
- {
- if (dw.getFocus() == 'site')
- site.findInSiteFiles("remote","site");
- else
- site.findInSiteFiles("remote", docPath);
- }
-
- }
-
- function canAcceptCommand()
- {
- var itemID = arguments[0];
- var docPath = dw.getDocumentPath('document');
- if (itemID == "connect")
- {
- return dw.getFocus() == 'site' && site.canConnect();
- }
- if (itemID == "put")
- {
- if (dw.getFocus() == 'site')
- return site.canPut("site");
- else
- return site.canPut(docPath);
- }
- if (itemID == "get")
- {
- if (dw.getFocus() == 'site')
- return site.canGet("site");
- else
- return site.canGet(docPath);
- }
- if (itemID == "checkout")
- {
- if (dw.getFocus() == 'site')
- return site.canCheckOut("site");
- else
- return site.canCheckOut(docPath);
- }
- if (itemID == "checkin")
- {
- if (dw.getFocus() == 'site')
- return site.canCheckIn("site");
- else
- return site.canCheckIn(docPath);
- }
- if (itemID == "undocheckout")
- {
- if (dw.getFocus() == 'site')
- return site.canUndoCheckOut("site");
- else
- return site.canUndoCheckOut(docPath);
- }
- if (itemID == "findlocal")
- {
- if (dw.getFocus() == 'site')
- return site.canFindInSiteFiles("local","site");
- else
- return site.canFindInSiteFiles("local",docPath);
- }
- if (itemID == "findremote")
- {
- if (dw.getFocus() == 'site')
- return site.canFindInSiteFiles("remote","site");
- else
- return site.canFindInSiteFiles("remote",docPath);
- }
- return true;
- }
-
- function setMenuText()
- {
- var itemID = arguments[0];
- if (itemID == "connect")
- {
- if (site.getConnectionState() == true)
- return MENU_Disconnect;
- else
- return MENU_Connect;
- }
- else
- return "";
- }
-